import React from 'react'
import './Item.css'
export default function Item(props) {
  // console.log(props);
const { todo, updateFn, deldateFn } = props;
  return (
    <li>
      <label>
        <input
          type="checkbox"
          checked={todo.isDone}
          onChange={() => {
            updateFn(todo.id);
          }}
        />
        <span>{todo.todoName}</span>
      </label>
      <button className="btn btn-danger"
        onClick={() => {
       deldateFn(todo.id);
      }}
      >删除</button>
    </li>
  );
}
